using System;
using System.Xml;

namespace Technullogy.Web.UI
{
    internal static class XmlParser
    {
        public static String GetNodeText(XmlDocument xmlDoc, String xPathQuery)
        {
            XmlNode oNode = xmlDoc.SelectSingleNode(xPathQuery);
            if (oNode != null)
                return oNode.InnerText;
            else
                return String.Empty;
        }

        public static String GetNodeAttributes(XmlDocument xmlDoc, String xPathQuery, String Attribute)
        {
            XmlNode oNode = xmlDoc.SelectSingleNode(xPathQuery);
            if (oNode != null)
                return oNode.Attributes.GetNamedItem(Attribute).InnerText;
            else
                return String.Empty;
        }
    }
}
